Loading Packages

Dr Deepak Varughese

What are packages

Packages are pre-written pieces of code that help make coding efficient.

Contain a variety of functions that can be used .

Think of it as a kind of “app” for your phone. Your base phone may have a texting service. But sometimes you add an extra app to make it a bit more efficient.

These are similar to plugins or extensions in other pieces of software.

CRAN

CRAN is a popular place to download packages

Comprehensive R Archive Network

Official Central Repository for the R Language

Anyone can submit a package to be hosted in CRAN but packages need to adhere to rigorous quality checks and have structured documentation before they are hosted on CRAN.

Packages are sometimes available from distribtion systems other than CRAN as well.

Using packages in R

Before package can be run in R , it needs to be

  • Installed on your computer (One time activity)

  • Loaded onto the environment (Has to happen everytime)

Installing Packages

Packages can be directly downloaded using the command

Loading Packages